<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{baseui/head :: head}">
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="牧中智慧畜牧大数据云平台"/>
    <meta name="author" content="牧中(上海)物联网科技有限公司"/>
    <link rel="shortcut icon" href="/webjars/images/favicon.png"/>
    <link rel="stylesheet" href="/webjars/js/layui/css/layui.css" media="all">
    <title>牧中智慧畜牧大数据云平台V1.0</title>


</head>
<style>
    input{


        font-size: 14px;
        color: #0e90d2;

    }

</style>
<body style="background-color:#fff">

<div class="wrapper wrapper-content" style="margin-top: 10px;">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="row">


                        <div class='row'>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">养殖场：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="breedFactoryName" value=" " type="text" />
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">业主：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="name"  type="text" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')"  />
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">手机号：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="phone"  type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"/>
                                    </div>
                                </div>

                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">业主密码：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="password" value="mz2017" type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"/>
                                    </div>
                               <span>默认密码（mz2017）</span>
                                </div>

                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">养殖类型：</label>
                                    <div class="col-sm-6">
                                    <select  class="select2"
                                            id="breedType">
                                        <option value="1">猪 </option>
                                        <option value="2">牛 </option>
                                        <option value="3">羊 </option>
                                        <option value="4">家禽</option>

                                    </select>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">存栏数：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="stockQuantity"  type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"/>
                                    </div>
                                </div>
                            </div>
                        </div>




                    </div>



                    <div class="row">

                        <div class='row'>

                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">经度：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="longitude"  type="text" onkeyup="value=value.replace(/[^\d.]/g,'')"/>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">纬度：</label>
                                    <div class="col-sm-6">
                                    <input class="form-control layer-date" id="latitude"  type="text" onkeyup="value=value.replace(/[^\d.]/g,'')"/>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                <label class="col-sm-3 control-label text-right">省:</label>
                                    <div class="col-sm-6">
                                       <select class="select2" id="province" style="max-width: 160px;">
                                           <option value="31">上海</option>

                                       </select>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">市:</label>
                                    <div class="col-sm-6">
                                        <select class="select2" id="city" style="max-width: 160px;">
                                            <option value="">请选择...</option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">县:</label>
                                    <div class="col-sm-6">
                                        <select class="select2" id="region" style="max-width: 160px;">
                                            <option value="">请选择...</option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">镇:</label>
                                    <div class="col-sm-6">
                                        <select class="select2" id="street" style="max-width: 160px;">
                                            <option value="">请选择...</option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">村庄:</label>
                                    <div class="col-sm-6">
                                        <select class="select2" id="village" style="max-width: 160px;">
                                            <option value="">请选择...</option>

                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">详细地址：</label>
                                    <div class="col-sm-6">
                                    <input class="col-sm-6 form-control layer-date" id="detail"  type="text" />
                                    </div>
                                </div>
                            </div>

                            <div class='col-sm-6'>
                                <div class='form-group'>
                                    <label class="col-sm-3 control-label text-right">协检员：</label>
                                    <div class="col-sm-6">
                                    <select class="select2" id="userxiejian" style="max-width: 160px;">
                                        <option value="">请选择...</option>

                                    </select>
                                    </div>
                                </div>
                            </div>
                        </div>



                    </div>

                </div>


            </div>

        </div>
    </div>

</div>
<span id="message" style="margin-left: 300px;color: red;font-size: 18px;" ></span>
<script type="text/javascript" src="/webjars/js/jquery.js"></script>
<script type="text/javascript" src="/webjars/js/jquery.gritter/js/jquery.gritter.js"></script>

<script type="text/javascript" src="/webjars/js/jquery.nanoscroller/jquery.nanoscroller.js"></script>
<script type="text/javascript" src="/webjars/js/behaviour/general.js"></script>
<script src="/webjars/js/jquery.ui/jquery-ui.js" type="text/javascript"></script>

<script type="text/javascript" src="/webjars/js/jquery.nestable/jquery.nestable.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="/webjars/js/jquery.select2/select2.min.js" type="text/javascript"></script>
<script src="/webjars/js/skycons/skycons.js" type="text/javascript"></script>
<script src="/webjars/js/bootstrap.slider/js/bootstrap-slider.js" type="text/javascript"></script>
<script type="text/javascript" src="/webjars/js/jquery.niftymodals/js/jquery.modalEffects.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.summernote/dist/summernote.min.js"></script>
<script type="text/javascript" src="/webjars/js/jquery.magnific-popup/dist/jquery.magnific-popup.min.js"></script>
<script src="/webjars/js/behaviour/voice-commands.js"></script>
<script src="/webjars/js/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/ecmascript" src="/webjars/jqgrid/js/i18n/grid.locale-cn.js"></script>
<script type="text/ecmascript" src="/webjars/jqgrid/js/jquery.jqGrid.min.js"></script>
<script src="/webjars/js/laydate/laydate.js"></script>
<script src="//vuejs.org/js/vue.min.js"></script>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
<script src="/webjars/js/layui/layui.js" charset="utf-8"></script>


<script type="text/javascript">


    $(document).ready(function () {

        App.init();
    })
 function tt() {
     $.ajax({
         type: "GET",
         url: "/management/factory/getxiejianyuan",
         dataType: "json",
         success: function (data) {
             var str = "";
             $.each(data, function (index, item) {
                 str += "<option value=" + item.userId + ">" + item.realName + "</option>";
                 $("#userxiejian").append(str);
                 str = "";
             })
         }

     });

     $.ajax({
         type: "GET",
         url: "/management/user/change",
         data: {
             provinceId: 31,
             level: 2
         },
         dataType: "json",
         success: function (data) {
             var str = "";
             $.each(data, function (index, item) {
                 str += "<option value=" + item.cityId + ">" + item.areaName + "</option>";
                 $("#city").append(str);
                 str = "";
             })
         }

     });
 }

tt();


    $("#city").change(function () {
        $("#region").html("");
        $("#region").html("<option value=''>请选择...</option>");
        if ($("#city").val() != "") {
            $.ajax({
                type: "GET",
                url: "/management/user/change",
                data: {
                    provinceId: $("#province").val(),
                    cityId: $("#city").val(),
                    level: 3
                },
                dataType: "json",
                success: function (data) {
                    var str = "";
                    $.each(data, function (index, item) {
                        str += "<option value=" + item.regionId + ">" + item.areaName + "</option>";
                        $("#region").append(str);
                        str = "";
                    })
                }

            })
        }

    })
    $("#region").change(function () {
        $("#street").html("");
        $("#street").html("<option value=''>请选择...</option>");
        if ($("#region").val() != "") {
            $.ajax({
                type: "GET",
                url: "/management/user/change",
                data: {
                    provinceId: $("#province").val(),
                    cityId: $("#city").val(),
                    regionId: $("#region").val(),
                    level: 4
                },
                dataType: "json",
                success: function (data) {
                    var str = "";
                    $.each(data, function (index, item) {
                        str += "<option value=" + item.streetId + ">" + item.areaName + "</option>";
                        $("#street").append(str);
                        str = "";
                    })
                }

            })
        }
    })
    $("#street").change(function () {
        $("#village").html("");
        $("#village").html("<option value=''>请选择...</option>");
        if ($("#street").val() != "") {
            $.ajax({
                type: "GET",
                url: "/management/user/change",
                data: {
                    provinceId: $("#province").val(),
                    cityId: $("#city").val(),
                    regionId: $("#region").val(),
                    streetId: $("#street").val(),
                    level: 5
                },
                dataType: "json",
                success: function (data) {
                    var str = "";
                    $.each(data, function (index, item) {
                        str += "<option value=" + item.villageId + ">" + item.areaName + "</option>";
                        $("#village").append(str);
                        str = "";
                    })
                }

            })
        }
    })



</script>


</body>
</html>
